<template>
  <div style="margin-top: 40px">
    <template v-if="list.length > 0">
      <a-timeline>
        <div v-for="item in list" :key="item">
          <a-timeline-item>
            <a-form :label-col="labelCol" :wrapper-col="wrapperCol">
              <a-row>
                <a-col :span="5">
                  <a-form-item label="分配护士"> 小明 </a-form-item>
                </a-col>
                <a-col :span="5">
                  <a-form-item label="联系方式"> 小明 </a-form-item>
                </a-col>
                <a-col :span="5">
                  <a-form-item label="分配时间"> 202101222 </a-form-item>
                </a-col>
              </a-row>
            </a-form>
          </a-timeline-item>
        </div>
      </a-timeline>
    </template>

    <a-empty v-else></a-empty>
  </div>
</template>
<script>
import { selectAbnormalByNumber } from "@/api/order/index.js";
import { init } from "echarts";
import { reactive, toRefs } from "@vue/reactivity";
export default {
  props: {
    number: {
      type: String,
      default: "",
    },
  },
  setup(props) {
    const data = reactive({
      list: [],
    });

    init();
    // 处理记录查询
    async function init() {
      let res = await selectAbnormalByNumber(props.number);
      if (res.success) {
        data.list = res.object;
      }
    }
    return {
      ...toRefs(data),
      abelCol: { style: { width: "100px", fontWeight: "bolder" } },
      wrapperCol: { span: 20, offset: 1 },
    };
  },
};
</script>
